package device

import (
	"context"

	"suci-go-zero/common/xerr"
	"suci-go-zero/internal/svc"
	"suci-go-zero/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type FirmwareUpgradeLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewFirmwareUpgradeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FirmwareUpgradeLogic {
	return &FirmwareUpgradeLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *FirmwareUpgradeLogic) FirmwareUpgrade(req *types.OtaInfo) error {
	logx.Infof("%+v", req)
	return xerr.NewErrCode(xerr.DB_ERROR)
}
